package json_utils

import (
	"encoding/json"
	"log"
)

func ToJsonStr(v interface{}) string {
	data, err := json.Marshal(v)
	if err != nil {
		return ""
	}
	return string(data)
}

func FormatJson(jsonStr string, target interface{}) {
	err := json.Unmarshal([]byte(jsonStr), &target)
	if err != nil {
		log.Println(err)
	}
}
